<template>
    <div class="count">
        <div class="topTit f f-a-c f-j-b">
            <div class="left f f-a-c">
                <img src="/src/status/money.png" class="logo" alt="">
                <div class="spn">H.S.国际问题研究平台</div>
            </div>
            <div class="right">
                <img @click="setting" src="/src/status/my.png" class="myStat" alt="">
            </div>
        </div>
        <div class="body">
            <!-- 热点时间 -->
            <div class="hotSpotTime f f-a-c f-j-b">
                <div class="hot">热点事件</div>
                <div class="Settings f f-a-c">
                    <img src="/src/status/qun.png" class="set" alt="">
                    <div class="text">订阅设置</div>
                </div>
            </div>
            <!-- tabbar切换 -->
            <div class="tab f f-a-c">
                <div class="one" @click="tabs(0)" :class="{ act: statis == 0 }">中国</div>
                <div class="one" @click="tabs(1)" :class="{ act: statis == 1 }">美国</div>
                <div class="one" @click="tabs(2)" :class="{ act: statis == 2 }">俄罗斯</div>
            </div>
            <!-- 这个是列表 -->
            <div class="list">
                <van-list offset="0" @load="onLoad">
                    <div v-for="(item, index) in list" class="listItem f f-a-c f-j-b" :key="index">
                        <img src="/src/status/2.png" class="shoopImg" alt="">
                        <div class="right f f-d-c">
                            <div class="tite">“千眼天珠”向日开 ——全球规模最大的综合孔径射电望远大的综合孔径射电望远镜落成记</div>
                            <div class="time">2023-10-07 07:19:50</div>
                        </div>
                    </div>
                </van-list>
            </div>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue'
import router from '../../router';
let statis = ref(0)
// vant组件列表
const list = ref(['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1']);
const loading = ref(true);
const finished = ref(false);

const onLoad = (e) => {
    console.log(e, '123');
};
// 点击切换ttabs
const tabs = (num) => {
    statis.value = num
}
// 去设置
const setting = () => {
    router.push('/setting')
}
</script>
<style lang="scss" scoped>
@function pxfn($px) {
    @return calc($px / 3.75) * 1vw;
}

.list {
    padding: pxfn(15);

    .listItem {
        width: pxfn(343);
        height: pxfn(112);
        border-bottom: pxfn(1) solid #edf3fa;

        .shoopImg {
            width: pxfn(120);
            height: pxfn(80);
            border-radius: pxfn(8);
            margin-right: pxfn(15);
        }

        .tite {
            font-size: pxfn(14);
            font-family: PingFang SC, PingFang SC-500;
            font-weight: 500;
            color: #1d2129;
            text-overflow: -o-ellipsis-lastline;
            overflow: hidden; //溢出内容隐藏
            text-overflow: ellipsis; //文本溢出部分用省略号表示
            display: -webkit-box; //特别显示模式
            -webkit-line-clamp: 2; //行数
            line-clamp: 2;
            -webkit-box-orient: vertical;
        }

        .time {
            font-size: pxfn(12);
            font-family: PingFang SC, PingFang SC-400;
            font-weight: 400;
            text-align: LEFT;
            color: #868d9c;
            margin-top: pxfn(20);
        }
    }
}

.tab {
    padding: 0 pxfn(15);

    .one {
        padding: pxfn(4) pxfn(6);
        border: pxfn(1) solid #e8eaef;
        border-radius: pxfn(6);
        font-size: pxfn(14);
        font-family: PingFang SC, PingFang SC-400;
        font-weight: 400;
        text-align: center;
        color: #1d2129;
        margin-right: pxfn(10);
    }

    .act {
        border: pxfn(1) solid #32bbea;
        color: #32BBEA;
    }
}

.body {
    height: calc(100vh - pxfn(48));

}

.list {
    margin-top: pxfn(10);
    height: calc(100vh - pxfn(150));
    // background-color: pink;
    overflow-y: auto;
}

.hotSpotTime {
    padding: pxfn(15);

    .hot {
        // background: #1d2129;
        font-size: pxfn(20);
        font-family: PingFang SC, PingFang SC-600;
        font-weight: 600;
        text-align: LEFT;
        color: #1d2129;
    }

    .Settings {
        .set {
            width: pxfn(11);
            height: pxfn(13);
        }

        .text {
            font-size: pxfn(14);
            font-family: PingFang SC, PingFang SC-400;
            font-weight: 400;
            text-align: LEFT;
            color: #32bbea;
        }
    }
}

.count {
    width: 100vw;
    height: 100vh;
    background-color: #fff;
    padding-top: pxfn(50);
}


.topTit {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: pxfn(48);
    border: 1px solid #edf3fa;
    padding: pxfn(15);
    z-index: 1;



    .logo {
        width: pxfn(27);
        height: pxfn(24);
        margin-right: pxfn(10);
    }


    .myStat {
        width: pxfn(24);
        height: pxfn(24);
    }
}

.spn {
    font-size: pxfn(24) !important;
    font-family: PingFang SC, PingFang SC-500;
    font-weight: 800 !important;
    color: #1d2129;
}
</style>